class Solution:
    def translateNum(self, num: int) -> int:
        strNum = str(num)
        lth = len(strNum)
        if lth == 0 or lth == 1:
            return 1
        dp = [1, 1]
        for i in range(2, lth+1, 1):
            if 10 <= int(strNum[i - 2] + strNum[i-1]) <= 25:
                dp.append(dp[i - 1] + dp[i - 2])
            else:
                dp.append(dp[i - 1])
        # print(dp)
        return dp[lth]


if __name__ == "__main__":
    mySol = Solution()
    myNum = 25
    print(myNum, ' has ', mySol.translateNum(myNum), ' ways to translate')
